I don't speak for Drexel, and Drexel doesn't listen to me...
+++++++++++++++++++++++++++
>From dschwarz@netcom.com (Dan Schwarz)
Date: Wed, 21 Feb 1996 03:37:32 GMT
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
In article <4f06q3$ltp@news.mcn.net>, jrichmond@mcn.net (Jason Richmond) wrote:
> I am writing an application for the Mac and I need to send output to two
> different network printers. I need to do this from within the program, hidden
> from the user. Is there any way to do this?
Yes, but it's an awful lot of work. My shareware program, "PrinterSwitch"
does this; it took a couple weeks of (part-time) coding to get the switching
code working properly. You can check it out at:
http://www.cs.brandeis.edu/~dan/home.html
Basically, what you have to do is this:
Write the appropriate 'alis' and 'STR ' resources into the System
file, these point to the printer driver you want to use.
Write the appropriate 'PAPA' and/or 'PSEL' resourcs into the printer driver's
resource fork.
Switch to the appropriate parsed PPD file (if you're using LaserWriter 7 or 8
drivers)
... but where to find the "appropriate" resources and PPD resources to use?
aha! that's the tough part. You have to make the user switch to the printer(s)
that are to be used, each in turn, then your code will have to read in these
resources and store them away safely somewhere. That's what I do.
If you have total control over the environment in which your application is to be used, i.e. this is an in-house application to run on one system, you can
prep this stuff ahead of time and store it in your application.
For more info, I highly recommend reading Apple's Printing Q&As, and
the issue of Develop magazine that talked about fun with PRGeneral and other
printing tips. You can find both on the web, at http://www.dev.info.apple.com/
good luck!
_Dan
---------------------------
>From Lawson English <english@primenet.com>
Subject: On obtaining rowBytes... (Was Re: Video Memory Access)